/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package haw.pr2.A2a.implementations;
import haw.pr2.A2a.interfaces.*;
/**
 *
 * @author Fabian Heidorn, Alexander Kaack
 */
public class PowerInKw extends AbstractScalar<Power> implements Power {
    
    private final double powerInKw;
    
    public PowerInKw(double powerInKw) {
        this.powerInKw=powerInKw;
    }

    @Override
    public Power inverse() {
        return new PowerInKw(-this.kw());
    }

    @Override
    public Power add(Power value) {
        return new PowerInKw(this.kw()+value.kw());
    }

    @Override
    public Power sub(Power value) {
        return new PowerInKw(this.kw()-value.kw());
    }

    @Override
    public Power mul(Power value) {
        return new PowerInKw(this.kw()*value.kw());
    }

    @Override
    public Power div(double value) {
        return new PowerInKw(this.kw()/value);
    }

    @Override
    public double div(Power value) {
        return this.kw()/value.kw();
    }

    @Override
    public boolean isZero() {
        return this.kw()==ZERO_POWER.kw();
    }

    @Override
    public boolean isValid() {
        return true;
    }

    @Override
    public double w() {
        return this.kw()*KW_IN_W;
    }

    @Override
    public double kw() {
        return this.powerInKw;
    }

    @Override
    public double mw() {
        return this.kw()+KW_IN_MW;
    }

}